package cn.hwadee.muying.commons.base;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.sql.Timestamp;

public abstract class BaseModel implements Serializable {

    /**
     * 主键
     */
    @TableId(type= IdType.AUTO)
    protected Long id;
    /**
     * 创建时间
     */
    @TableField("createDate")
    protected Timestamp createDate;
    /**
     * 更新时间
     */
    @TableField("updateDate")
    protected Timestamp updateDate;
    /**
     * 删除时间
     */
    @TableField("deleteDate")
    protected Timestamp deleteDate;
    /**
     * 是否被删除，取代sql中判断删除时间datetime为null
     */
    protected Boolean valid;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    public Timestamp getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Timestamp updateDate) {
        this.updateDate = updateDate;
    }

    public Timestamp getDeleteDate() {
        return deleteDate;
    }

    public void setDeleteDate(Timestamp deleteDate) {
        this.deleteDate = deleteDate;
    }

    public Boolean getValid() {
        return valid;
    }

    public void setValid(Boolean valid) {
        this.valid = valid;
    }

    public static final String ID = "id";

    public static final String VERSION = "version";

    public static final String CREATETIME = "createDate";

    public static final String UPDATETIME = "updateDate";

    public static final String DELETETIME = "deleteDate";

    public static final String VALID = "valid";
}
